/**
 * @Author ZhangCuirong
 * @Date 2025/9/2 8:51
 * @description:
 */
public class Solution268 {
    public int missingNumber(int[] nums) {
        int res = 0;
        for (int i = 0; i <= nums.length; i++) {
            res ^= i;
        }
        for (int i = 0; i < nums.length; i++) {
            res ^= nums[i];
        }
        return res;
    }
}
